<template>
  <div>
    city
  <button v-for="item of hots" :key="item" @click="handleCity(item)">{{item}}</button>
  </div>
</template>

<script>
export default {
  data(){
    return {
      hots:["武汉","长沙","广州"]
    }
  },
  methods:{
    handleCity(city){
      this.$router.back()
      console.log(city);
      localStorage.setItem("city",city);
    }
  }
}
</script>
<style scoped>
</style>